mui.plusReady(function() {
	window.addEventListener('uid', function(event) {
		var uid = event.detail.uid;
		mui.post(http('Api/User/articleIist'), {
			uid:uid
		}, function(data) {
			list(data);
		}, 'json');
	});
	
	function list (data) {
		var html = '';
		plus.nativeUI.closeWaiting();
		for (var i in data)
		{
			var d = data[i];
			html = '<li class="mui-table-view-cell mui-media" id="content" aid='+d.aid+'>\
					<a href="javascript:;">\
						<img class="mui-media-object mui-pull-left" src="'+http('')+d.thumb+'">\
						<div class="mui-media-body">'+
						d.atitle+'\
							<p class="mui-ellipsis">'+d.digest+'</p>\
						</div>\
					</a>\
				</li>';
			$("#list").append(html);
		}
	}
	
	$("#content").live('tap',function () {
		var targetPage = null;
		var id = $(this).attr('aid');
		plus.webview.create('content.html','content.html',{
			scrollIndicator:'none'
		})
		if (!targetPage) { 
			targetPage = plus.webview.getWebviewById('content.html');
		}
		mui.fire(targetPage, 'newsId', {
			id: id
		});
		plus.nativeUI.showWaiting();
		plus.webview.show('content.html','zoom-fade-out',300);
	})
	
	//关闭当前窗口
	plus.key.addEventListener('backbutton',function () {
		plus.webview.currentWebview().close();
	})
})